export const RegExpConst = {
  integerNumber: {
    pattern: /^([0]|[1-9][0-9]*)$/,
    message: '请输入正确的整数'
  },
  decimalNumber: {
    pattern: /^([0]|(([1-9]\d*)(\.\d{1,2})?)$|(0\.0?([1-9]\d?)))$/,
    message: '请输入正确的数字'
  },
  name: {
    pattern: /^[\u4E00-\u9FA5]{2,4}$/,
    message: '请输入正确的姓名',
  },
  phoneNo: {
    pattern: /^1[3456789](\d{6}|\*\*\*\*\*\*)\d{3}$/,
    message: '请输入正确的手机号',
  },
  idCard: {
    pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
    message: '请输入正确的身份证号'
  },
}

export const RolesType = {
  T: ['T'],
  T_M: ['T', 'M'],
  T_M_VL: ['T', 'M', 'VL'],
  T_NM: ['T', 'NM'],
  T_M_NM: ['T', 'M', 'NM'],
  T_M_L1_C: ['T', 'M', 'L1', 'C'],
  L1_C: ['L1', 'C'],
  T_M_L1_C_V: ['T', 'M', 'L1', 'C', 'V'],
  T_M_L1: ['T', 'M', 'L1'],
  T_M_F: ['T', 'M', 'F'],
  T_V: ['T', 'V'],
  T_M_V_B: ['T', 'M', 'V', 'B'],
  T_M_L1_VL_V: ['T', 'M', 'L1', 'VL', 'V'],
  T_M_L1_VL: ['T', 'M', 'L1', 'VL'],
  T_HR: ['T', 'HR'],
  V_F: ['V', 'F'],
  L1: ['L1'],
  canChangeCallLine: ['T', 'CALL_LINE_MANAGER'],
  canToWaitVisit: ['T', 'M', 'L1', 'C'],
  canModifyBookTime: ['T', 'M', 'L1', 'C'],
  canToVisited: ['T', 'M', 'L1'],
  canToHasScheme: ['T', 'M', 'V'],
  canAllocateClerk:  ['T', 'M', 'F'],
  canToSuspend: ['T', 'M', 'V'],
  canToNoScheme: ['T', 'M', 'V'],
  canToHasDone: ['T', 'M', 'V'],
  isReviewing: ['T', 'M', 'V'],
  isApproved: ['T', 'M', 'V'],
  canNewAgain: ['T', 'M', 'L1', 'C'],
  canCommission: ['T', 'M', 'V', 'VL'],
  canCommissionAgain: ['T', 'M', 'VL'],
  canTransfer: ['T', 'M', 'VL', 'L1'],
  canRecommendSolution: ['T', 'M', 'L1', 'VL']
}

export const StatusType = {
  canSave: ['new', 'wait-visit', 'visited', 'has-agent', 'suspend', 'no-scheme', 'has-scheme'],
  canCheckBigData: ['wait-visit', 'visited', 'has-agent', 'suspend', 'no-scheme', 'has-scheme'],
  
  canToWaitVisit: ['new'],
  canModifyBookTime: ['wait-visit'],
  canToVisited: ['wait-visit'],
  canAllocateClerk: ['visited'],
  canToSuspend: ['has-agent'],
  canToNoScheme: ['has-agent', 'suspend'],
  canToHasScheme: ['has-agent', 'suspend', 'no-scheme'],
  canToHasDone: ['has-scheme'],
  isReviewing: ['reviewing'],
  isApproved: ['approved'],
  canCommission : ['issued'],
  canCommissionAgain: ['commission'],
  canNewAgain: ['no-scheme', 'rejected', 'commission', 'has-done', 'closed'],
  isIssued: ['issued'],
  canClose: ['new', 'wait-visit'],
  canAddSolution: ['has-scheme'],
  canRecommendSolution: ['new', 'wait-visit', 'visited', 'has-agent', 'suspend', 'no-scheme', 'has-scheme'],
  canShowSolution: ['has-scheme', 'reviewing', 'rejected', 'approved', 'issued', 'commission', 'has-done'],
}

export const DefaultCities = ['310000', '320600', '320500', '320100']

export const StatusMap = {
  'new': '新名单',
  'wait-visit': '待上门',
  'visited': '已上门',
  'has-agent': '已分配',
  'suspend': '面谈终止',
  'no-scheme': '无方案',
  'has-scheme': '有方案',
  'reviewing': '审批中',
  'rejected': '已拒绝',
  'approved': '已通过',
  'issued': '已放款',
  'commission': '已回款',
  'has-done': '已完结',
  'closed': '已关闭',
  'recycled': '已回收',
  'global-search': '全局搜索'
}

export const NeedValidPanels = [
  'baseInfo',
  'requirementInfo',
  'personalInfo',
  'workInfo',
  'incomeInfo',
  'debtInfo',
  'houseInfo',
  'carInfo',
  'policyInfo',
  'propertyInfo',
  'creditInfo'
]

export const NeedNormalizePanels = [
  'requirementFieldsInfo',
  'personalFieldsInfo',
  'workFieldsInfo',
  'incomeFieldsInfo',
  'debtFieldsInfo',
  'houseFieldsInfo',
  'carFieldsInfo',
  'policyFieldsInfo',
  'propertyFieldsInfo',
  'creditFieldsInfo',
]

export const ProductTypes = [
  {
    key: 'creditLoan',
    label: '信用贷'
  },
  {
    key: 'houseMortgage',
    label: '房抵'
  },
  {
    key: 'carMortgage',
    label: '车抵'
  },
  {
    key: 'cardInstallment',
    label: '卡分期'
  },
  {
    key: 'enterpriseTaxLoan',
    label: '企业税贷'
  },
  {
    key: 'enterpriseTicketLoan',
    label: '企业票贷'
  },
  {
    key: 'other',
    label: '其他'
  }
]